package com.example.mappers;

import com.example.data.User.User;
import com.example.data.User.UserDo;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;

public class UserRowMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs,int i) throws SQLException {
           User userDo = new UserDo();
        userDo.setId(rs.getLong("id"));
        userDo.setName(rs.getString("name"));
        userDo.setDept_id(rs.getLong("deptId"));
        userDo.setDept_name(rs.getString("deptName"));
        userDo.setAuth(rs.getInt("auth"));
        userDo.setType(rs.getInt("userType"));// does it need to change into integer

            return userDo;
            }
}

//    public static final int STAFF = 0;
//    public static final int DEPARTMENT_MANAGER = 1;
//    public static final int VICE_GENERAL_MANAGER = 2;
//    public static final int GENERAL_MANAGER = 3;
//    public static final int GENERAL = -1;
//    public static final int FINANCIAL = -2;
//    public static final int EXECUTIVE = -3;
//    public static final int ADMINISTRATOR = -4;